const { merge } = require('webpack-merge')
const baseConfig = require('./webpack.common')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const OptimizeCssAssetsWebpackPlugin = require('optimize-css-assets-webpack-plugin')

module.exports = merge(baseConfig, {
  mode: 'production',
  devtool: false,
  //   optimization: { concatenateModules: true },
  plugins: [
    new CopyWebpackPlugin({ patterns: [{ from: 'public', to: '.' }] }), // 开发环境中应用，修改代码，刷新页面后文件会消失
    new OptimizeCssAssetsWebpackPlugin()
  ]
})
